glcontext: Don't spew warnings on surfaceless contexts
authorBenjamin Otte <otte@redhat.com>
Thu, 6 Jan 2022 18:23:29 +0000 (19:23 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 6 Jan 2022 18:23:29 +0000 (19:23 +0100)
Get the display directly instead of via the nonexisting surface.

gdk/gdkglcontext.c

index 9ab690f6fa110858a89bebb157754b71d8e395a3..7acbeafe68a216ce785b35a53c17db2d001e1e7a 100644 (file)
@@ -185,8 +185,7 @@ gdk_gl_context_dispose (GObject *gobject)
 
   if (priv->egl_context != NULL)
     {
-      GdkSurface *surface = gdk_gl_context_get_surface (context);
-      GdkDisplay *display = gdk_surface_get_display (surface);
+      GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
       EGLDisplay *egl_display = gdk_display_get_egl_display (display);
 
       if (eglGetCurrentContext () == priv->egl_context)